package com.hzp.lolnews.activity.model;

import android.content.Context;

import cn.bmob.v3.BmobUser;
import cn.bmob.v3.listener.SaveListener;

public class LoginBiz implements IUserLoginBiz {

    @Override
    public void login(Context context,final String name, final String pwd, final OnLoginListener listener) {
        BmobUser user = new BmobUser();
        user.setUsername(name);
        user.setPassword(pwd);
        user.login(context, new SaveListener() {
            @Override
            public void onSuccess() {
                listener.loginSucceed();
            }

            @Override
            public void onFailure(int i, String s) {
                listener.loginFailed();
            }
        });
    }

    @Override
    public void register(OnLoginRegisterListener listener) {
        listener.register();
    }




}
